package com.kongge.viewdisplayframeworklib.control;

import android.app.Activity;

import com.kongge.viewdisplayframeworklib.landscape.AbstractUIManager;
import com.kongge.viewdisplayframeworklib.model.LayoutIdFactory;
import com.kongge.viewdisplayframeworklib.model.PageControlCreater;
import com.kongge.viewdisplayframeworklib.model.PageNodeManager;
import com.kongge.viewdisplayframeworklib.model.RuntimeManager;

public class GlobalMagager {

	private static PageNodeManager pageNodeManager;
	private static PageControlCreater pageControlCreater;
	private static LayoutIdFactory layoutIdFactory;
	private static Activity mActivity;
	private static NavigateBarControl mNavigateBarControl;
	private static AbstractUIManager tabControl;
	private static boolean isStartLandscapeActivity;

	public static void SetGlabalActivity(Activity activity) {
		mActivity = activity;
	}

	public static void init(String configPath) {
		pageNodeManager = new PageNodeManager();
		pageControlCreater = new PageControlCreater();
		tabControl = new TabControl();
		layoutIdFactory = new LayoutIdFactory();
		mNavigateBarControl = new NavigateBarControl();

		pageNodeManager.init(configPath);
		tabControl.init();
	}

	public static PageNodeManager getPageNodeManager() {
		return pageNodeManager;
	}

	public static PageControlCreater getPageControlCreater() {
		return pageControlCreater;
	}

	public static AbstractUIManager getTabControl() {
		return tabControl;
	}

	public static LayoutIdFactory getLayoutIdFactory() {
		return layoutIdFactory;
	}

	public static Activity getGlobalActivity() {
		return mActivity;
	}

	public static NavigateBarControl getNavigateBarControl() {
		return mNavigateBarControl;
	}
	
	public static void setTabControl(AbstractUIManager tabControl) {
		GlobalMagager.tabControl = tabControl;
	}


	public static boolean isStartLandscapeActivity() {
		return isStartLandscapeActivity;
	}

	public static void setStartLandscapeActivity(boolean isStartLandscapeActivity) {
		GlobalMagager.isStartLandscapeActivity = isStartLandscapeActivity;
	}

	public static RuntimeManager getRuntimeManager() {
		return RuntimeManager.getInstance();
	}
}
